<?php
/**
 * 文章分类列表模板
 */
use common\widgets\ActiveForm;
use common\widgets\FormTable;
use common\models\DAO\ArticleType;

$form = ActiveForm::begin();

echo FormTable::widget([
    'model' => $model,
    'form' => $form,
    'rows' => [
        'parentID' => ['type' => FormTable::INPUT_WIDGET,
            'widgetClass' => 'common\widgets\SelectTree',
            'options' => [
                'pluginOptions' => [
                    'data' => ArticleType::find()->where(['type' => 'general'])->asArray()->all(),
                    'columnPid' => 'parentID',
                    'columnName' => 'typeName',
                    'initValue' => '--请选择分类--',
//                    'isDisabled' => true,
                ]
            ]
        ],
        'typeName' => ['type' => FormTable::INPUT_TEXT],
        'type' => [
            'type' => FormTable::INPUT_RADIO_LIST,
            'items' => ['page' => '单页', 'general' => '普通'],
            'options' => [
                'defaultValue' => 'general',
            ]
        ],
        'isMenu' => [
            'type' => FormTable::INPUT_RADIO_LIST,
            'items' => [0 => '否', 1 => '是'],
            'options' => [
                'defaultValue' => 1
            ]
        ],
        'content' => [
            'type' => FormTable::INPUT_WIDGET,
            'widgetClass' => 'common\widgets\Simditor',
            'options' => [
                'pluginOptions' => [
                    'options' => ['placeholder' => '',],
                ]
            ],
            'width' => '8'
        ],
        'sort' => ['type' => FormTable::INPUT_TEXT,'width'=>1],
    ]
]);

ActiveForm::end();